package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmNewsReviewDto;
import com.heima.wemedia.service.NewsAutoScanService;
import com.heima.wemedia.service.WmNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class ReviewWmNewsController {
    @Autowired
    private WmNewsService wmNewsService;
    @Autowired
    private NewsAutoScanService newsAutoScanService;

    /**
     * 查询需要人工审核的文章列表
     */
    @PostMapping("news/list_vo")
    public PageResponseResult listVo(@RequestBody WmNewsReviewDto reviewDto){
        return wmNewsService.listVo(reviewDto);
    }
    /**
     * 文章详情
     */
    @GetMapping("news/one_vo/{id}")
    public ResponseResult WmNewById(@PathVariable("id") Integer id){
        return wmNewsService.WmNewById(id);
    }

    /**
     * 审核失败
     * @param reviewDto
     * @return
     */
    @PostMapping("news/auth_fail")
    public ResponseResult authFail(@RequestBody WmNewsReviewDto reviewDto){
        return wmNewsService.authFail(reviewDto);
    }

    /**
     * 审核成功
     * @param reviewDto
     * @return
     */
    @PostMapping("news/auth_pass")
    public ResponseResult authPass(@RequestBody WmNewsReviewDto reviewDto){
        return wmNewsService.authPass(reviewDto);
    }

}
